using UnityEngine;

public class ComeToPvp : MonoBehaviour
{
	public GameObject labelFirst;

	public GameObject labelLast;

	public bool clicked;

	public bool ended;

	public void Awake()
	{
		ended = BCWStorage.Get<bool>("ComeToPvpLast");
		clicked = BCWStorage.Get<bool>("ComeToPvpFirst");
		labelFirst.SetActive(false);
		labelLast.SetActive(false);
	}

	public void OnClick()
	{
		if (!ended)
		{
			clicked = true;
			BCWStorage.Set("ComeToPvpFirst", clicked);
		}
	}

	public void OnEnable()
	{
		if (clicked)
		{
			if (!ended)
			{
				labelFirst.SetActive(false);
				labelLast.SetActive(true);
			}
			else
			{
				BCWStorage.Set("ComeToPvpFirst", true);
				ended = true;
				base.gameObject.SetActive(false);
			}
		}
		else
		{
			labelFirst.SetActive(true);
			labelLast.SetActive(false);
		}
	}
}
